package com.adam.example.search.converter;

import com.fasterxml.jackson.databind.util.StdConverter;
import org.elasticsearch.geometry.Point;

public class StringToGeoPointConverter extends StdConverter<String, Point> {

    @Override
    public Point convert(String value) {
        String[] array = value.split(",");
        double lat = Double.parseDouble(array[0]),
                lon = Double.parseDouble(array[1]);
        return new Point(lon, lat);
    }

}
